import request from '@/utils/request'
/**
 * @author 丁凯
 * @description 查询所有资源信息
 */
export const getResourseList = () => {
  return request.get('resourse')
}
/**
 * @author
 * @description  根据id删除资源
 * @param {number} id
 */
export const deleteResourse = id => {
  return request.delete(`resourse/${id}`)
}
/**
 * @description 添加资源
 * @param {object} resourse 添加的资源对象
 */
export const createResourse = resourse => {
  return request.post('resourse', resourse)
}
/**
 * @description 修改资源
 * @param {Number} id 修改资源的id
 * @param {Object} resourse 修改后的资源信息
 */
export const updateResourse = (id, resourse) => {
  return request.put(`resourse/${id}`, resourse)
}
/**
 * @description 根据id查询资源
 * @param {Number} id 需要查询的资源的id
 */
export const selectResourseById = id => {
  return request.get(`resourse/${id}`)
}
